package com.bruan.d3_transform_stream;

import java.io.*;

public class Test2 {
    public static void main(String[] args) {

        try(
                //1得到原始字节流
                InputStream is = new FileInputStream("file-io-app\\zlive.txt");
                //2转换为字符输入流（制定格式）
                Reader isr =  new InputStreamReader(is,"GBK");
                //3把字符输入流包装成缓冲
                BufferedReader bfr = new BufferedReader(isr);
                ) {
            String line;
            while((line=bfr.readLine())!=null){
                System.out.println(line);
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
